# 需求：打开注册页面A，暂停2秒后，滚动条拉到最底层

from time import sleep
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By

from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait

# 1.打开浏览器
path = r"D:\chromedriver-win64\chromedriver.exe" # 定义驱动路径
driver = webdriver.Chrome(executable_path=path)
# 放大浏览器
driver.maximize_window()
# 2.输入访问地址
driver.get("http://121.43.169.97:8848/pageA.html")

sleep(2)
# 滚动条拉到最底层
js = "window.scrollTo(0,10000)" # 0 x,10000y
# 调用执行js语句方法
driver.execute_script(js)

sleep(2)
# 滚动条拉到最上层
js2 = "window.scrollTo(0,0)"
driver.execute_script(js2)
